<?php

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'lxSystem'], function () {
    Auth::routes();
});


Route::get('/home', 'HomeController@index');
Route::group(['namespace' => 'lxSystem', 'prefix' => 'lxSystem', 'middleware' => 'auth'], function () {
    Route::get('/', 'IndexController@index');
    Route::patch('brands/sort_order', 'BrandController@sort_order');
    Route::patch('brands/is_something', 'BrandController@is_something');
    Route::resource('brands', 'BrandController');
    Route::post('upload', 'FileController@upload');

    Route::patch('categories/sort_order', 'CategoryController@sort_order');
    Route::patch('categories/is_something', 'CategoryController@is_something');
    Route::get('/copy/{copy}', 'BrandController@copy')->name('brands.copy');

    Route::patch('products/is_something', 'ProductController@is_something');
    Route::patch('products/change_stock', 'ProductController@change_stock');
    Route::delete('products/destroy_checked', 'ProductController@destroy_checked');
    Route::resource('categories', 'CategoryController');
    Route::resource('products', 'ProductController');

    Route::resource('customer', 'CustomerController');
    Route::delete('gallery/delete', 'ProductController@gallery_delete');

//    快递运费
    Route::resource('express', 'ExpressController');

    //商品回收站
    Route::get('trash', 'ProductController@trash');
    Route::get('restore/{id}', 'ProductController@restore');
    Route::delete('/{product}/force_destroy', 'ProductController@force_destroy');
    Route::delete('force_destroy_checked', 'ProductController@force_destroy_checked');
    Route::post('restore_checked', 'ProductController@restore_checked');
//清除缓存
    Route::get('clean_cache', 'IndexController@clean_cache');

    //广告中心
    Route::resource('ad_category', 'AdCategoryController');
//   Route::resource('ad', 'AdController');

    Route::get('/ad', function () {
        return view('lxSystem.ad.index');
    });

});

Route::group(['namespace' => 'home\lxShop'], function () {
    Route::get('/', 'IndexController@index')->name('index');
    Route::get('more', 'IndexController@more');
});